<?php
namespace app\index\controller;

use think\Controller;
use think\Request;

class B extends Controller
{
    // 控制器初始化
    public function _initialize()
    {
        echo 'init<br/>';
    }

    public function index()
    {
        Request::hook('user', 'getUserInfo');

        $info = Request::instance()->user(12312);


        dump($info);
    }



    public function hello()
    {
        // 请求信息
        $request = Request::instance();
//        print_r($request->dispatch());
//        print_r($request);

//        dump($request->header());

        dump($request->ext());

//        if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) {

//        dump(input('?param.name'));
//        dump(input('name'));

        return 'Hello,World!';
    }

    public function data()
    {
        return 'data';
    }

}